package com.ophiux.order.api.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.ophiux.order.api.feign.IOrderFeignApi;
import com.ophiux.order.api.fallback.OrderAPIFallback;

@Component
public class OrderAPIFallbackFactory implements FallbackFactory<IOrderFeignApi> {

    @Override
    public IOrderFeignApi create(Throwable throwable) {
        OrderAPIFallback fallback = new OrderAPIFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}